﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
</head>
<body>


	<div class="ibox-content">
		<form class="form-horizontal" id="dataform"
			onsubmit="javascripr:return false;">
			<input type="hidden" name="projId" value="${projId}">

			<c:if test="${obj ne null }">
				<input type="hidden" name="id" value="${obj.id }">
			</c:if>

			<div class="form-group">
				<label class="col-sm-2 control-label">父类型</label>
				<div class="col-sm-4">
					<select class="form-control " size="1" name="parentId"
						id="parentId">
						<option value="-10" selected="selected">一级功能</option>
					</select>
				</div>
				<label class="col-sm-2 control-label  ">需求名称：</label>
				<div class="  col-sm-4">
					<input type="text" name="name" value="${obj.name }"
						class="form-control radius" dataType="*1-50">
					<div class="Validform_checktip"></div>
				</div>
				<div class="Validform_checktip"></div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">需求类型</label>
				<div class="col-sm-4">
					<select class="form-control autoFull" name="type" dataType="*1-20"
						ignore="ignore"
						data-url="${path}/admin/dataDictionary/showDataDictionary"
						data-filed="name" data-value="name" data-param="{type:'需求类型'}"
						data-def="${obj.type}">
						<option value="">--请选择需求类型--</option>
					</select>
				</div>
				<label class="col-sm-2 control-label  ">优先级：</label>
				<div class="  col-sm-4">
					<select class="form-control autoFull" name="priority"
						dataType="*1-20" ignore="ignore"
						data-url="${path}/admin/dataDictionary/showDataDictionary"
						data-filed="name" data-value="name" data-param="{type:'需求优先级'}"
						data-def="${obj.priority}">
						<option value="">--请选择优先级--</option>
					</select>
				</div>
				<div class="Validform_checktip"></div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">需求状态</label>
				<div class="col-sm-4">
					<select class="form-control autoFull" name="status"
						dataType="*1-20" ignore="ignore"
						data-url="${path}/admin/dataDictionary/showDataDictionary"
						data-filed="name" data-value="name" data-param="{type:'需求状态'}"
						data-def="${obj.status}">
						<option value="">--请选择状态--</option>
					</select>
				</div>
				<label class="col-sm-2 control-label  ">备注：</label>
				<div class="  col-sm-4">
					<input type="text" name="remark" value="${obj.remark }"
						class="form-control radius" >
					<div class="Validform_checktip"></div>
				</div>
				<div class="Validform_checktip"></div>
			</div>



			<div class="form-group ">
				<div class="col-sm-12 text-center">
					<a href="javascript:;" onclick="myForm.submit()"
						class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp;
					<button onclick="MTools.closeForm()" class="btn btn-danger radius"
						type="button">取消</button>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		$(".select2").select2();
		//下拉框自动赋值
		MTools.autoFullSelect();
		//带搜索的下拉框
		var myForm = MForm.initForm({
			invokeUrl : "${path}/admin/interfaceCate/addOrModify",
			afterSubmit : function() {
				parent.initFunctionList();
			},
		});
		initFunctionList();
		/**
		 * 初始化功能列表
		 */
		function initFunctionList() {
			$.AjaxProxy({
				a : false,
				c : false
			}).invoke(
					"${path}/admin/interfaceCate/all?projId=${projId}",
					function(loj) {
						$("#parentId").createSelectTree(
								loj.attr("result").rows, {
									append : true,
								});
					});

		}
	</script>
</body>
</html>